@extends('admin::layouts.master')
@section('content')
    <div class="modal-header">
        <h3 id="ModalLabel">{{ $title }}</h3>
    </div>
    {{ Form::model($product,
     array( 'url'     => $packageAdmin.'/admin/product/store',
            'method'  => 'post',
            'enctype' => 'multipart/form-data',
            'role'    => 'form' ,
            'class'   => 'form-horizontal'))
        }}
        <ul class="flash_error">
            @foreach($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
        <div class="modal-body">
            <div class="form-group">
                {{ Form::label('product_name', 'Product name', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-5">
                    {{ Form::text('product_name', null, array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('product_name') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('product_model', 'Product Model', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-5">
                    {{ Form::text('product_model', null, array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('product_model') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('product_quantity', 'Product quantity', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-3">
                    {{ Form::text('product_quantity', null, array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('product_quantity') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('product_price', 'Price', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-3">
                    {{ Form::text('product_price', Input::old('product_price'), array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('product_price') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('manufacturer_id', 'Manufacturer', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-3">
                    {{ Form::select('manufacturer_id', $manufacturer, Input::old('manufacturer_id'), array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('manufacturer_id') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('category_id', 'Category', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-3">
                    {{ Form::select('category_id', $category, Input::old('category_id'), array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('category_id') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('product_description', 'Description', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-10">
                    {{ Form::textarea('product_description', null, array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('product_description') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('product_keywords', 'Keywords', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-10">
                    {{ Form::textarea('product_keywords', null, array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('product_keywords') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('product_url_seo', 'Url seo', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-10">
                    {{ Form::text('product_url_seo', null, array('class' => 'form-control')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('product_url_seo') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

            <div class="form-group">
                {{ Form::label('product_content', 'Content', array('class' => 'control-label  col-sm-2')) }}
                <div class="col-sm-10">
                    {{ Form::textarea('product_content', null, array('class' => 'form-control ckeditor')) }}
                </div>
                <ul class="flash_error">
                 @foreach($errors->get('product_content') as $error)
                 <li>{{ $error }}</li>
                 @endforeach
                </ul>
            </div>

           <div class="form-inline">
              {{ Form::label('status', 'Status', array('class' => 'control-label col-sm-2'))}}
              <div class="col-sm-10">
                  <label class="radio-inline">
                  {{ Form::radio('status', 1 , true, array('id' => 'published')) }}
                    Published
                  </label>
                  <label class="radio-inline">
                  {{ Form::radio('status', 0, false, array('id' => 'unpublished')) }}
                    Unpublished
                  </label>
                  <ul class="flash_error">
                     @foreach($errors->get('status') as $error)
                     <li>{{ $error }}</li>
                    @endforeach
                   </ul>
               </div>
           </div>

            <div class="form-group">
                {{ Form::label('product_image_main', 'Image', array('class' => 'col-sm-2 control-label'))  }}
                <div class="col-sm-10">
                    {{ Form::button('Upload', array('class' => 'btn', 'style' => 'position: absolute; top:0 ;left :0;')); }}
                    {{ Form::file('files[]',  array('style' => 'position: absolute; top:0 ;left :0; opacity: 0; width: 84px;', 'url' => URL::route('upload'), 'id' => 'uploadFile')) }}
                    @if (Input::old('product_image_thumbnail', $product->product_image_thumbnail))
                        {{ HTML::image(URL::to('/public').'/'.Input::old('product_image_thumbnail', $product->product_image_thumbnail), '', array('id' => 'image-show', 'style' => 'padding-left: 70px;')) }}
                    @endif
                </div>
            </div>
        </div> <!-- end modal-body -->
        <div class="modal-footer">
            {{ Form::hidden('id') }}
            {{ Form::hidden('product_image_main') }}
            {{ Form::hidden('product_image_thumbnail') }}
            {{ Form::submit($product->id ? 'Update': 'Save', array('class' => 'btn btn-primary')) }}
            {{ Form::button('Clear', array('class' => 'btn btn-default', 'type' => 'reset')) }}
        </div>

    {{ Form::close() }}
@stop